//
//  SEGPGCNaviHeadView.m
//  NavigationBarTest
//
//  Created by Clavis on 2019/2/19.
//  Copyright © 2019 Clavis. All rights reserved.
//

#import "SEGPGCNaviHeadView.h"
#import <Masonry.h>

@implementation SEGPGCNaviHeadView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.contentLabel = ({
            UILabel *lable = [[UILabel alloc] init];
            [self addSubview:lable];
            lable.textColor = UIColor.blackColor;
            lable.font = [UIFont systemFontOfSize:12];
            lable.text = @"吃货频道";
            lable;
        });
        
        self.contentImageView = ({
            UIImageView *imageView = [[UIImageView alloc] init];
            [self addSubview:imageView];
            imageView.image = [UIImage imageNamed:@"image"];
            imageView;
        });
        
        
        [self.contentImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.equalTo(self);
            make.width.height.mas_equalTo(30);
        }];
        
        [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentImageView.mas_right).mas_offset(5);
//            make.centerY.mas_offset(0);
            make.centerY.equalTo(self);
        }];
        
        
        
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
        [self addGestureRecognizer:tap];
    }
    return self;
}

- (void)tapAction:(UITapGestureRecognizer *)gesture {
    NSLog(@"tap tap tap");
}

@end
